-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine sequential mouse movement events #300
base: master
Are you sure you want to change the base?
Conversation
Previously on Linux (not Windows), if you opened Klystrack and dragged with a high polling rate mouse, the program would lag processing SDL_MOUSEMOTION events and redrawing the screen. This fixes the bug.
Anyway I've been told the "proper" fix is to not render a new frame on every mouse movement, not to merge "similar" mouse updates together (but still wait a frame every time you press or release the cursor). Unfortunately that might be a bigger change to the event loop than this PR (IDK, I didn't look into exactly what needs to be changed), and I don't plan to work on that right now. |
Did you check if the FX tab works fine after this? The delay taps can be dragged and I remember those are a bit finicky to get synced with the mouse movement. |
I'm actually new to klystrack and don't have any real experience with the program. Nonetheless dragging the delay taps does seem to work right. Interestingly, dragging the background moves the active delay tap rather than deselecting it; is this intentional? However I have noticed some janky mouse behavior that persists across Windows without this change, Linux with lag, and Linux with my lag fix:
https://www.youtube.com/watch?v=7a1xCkPPabM RIP annotations... seems https://invidious.snopyta.org/embed/7a1xCkPPabM?iv_load_policy=1 still works |
Not sure if the tap deselection when clicking should be there but I wouldn't be surprised if it wasn't. The double clicking thing comes from the fact the mouse click implements a kind of keyrepeat just like the keyboard. You can then hold the mouse button down to change some value (it receives multiple separate click events). |
A few more things:
|
I think one disadvantage of this change is that when I open a menu and move the mouse quickly up and down over other menu items, it won't reliably open them (whereas GTK and Qt apps do). It also doesn't help that Klystrack's menu items are so short vertically. |
Previously on Linux (not Windows), if you opened Klystrack and dragged with a high polling rate mouse, the program would lag processing SDL_MOUSEMOTION events and redrawing the screen (#299). This fixes the bug.
Note that this PR changes the submodule to point to a commit that only exists in my fork (https://github.com/nyanpasu64/klystron/tree/fix-high-refresh-mouse), and pulls in changes from klystron on top of my own changes. To my current understanding, I'd merge the klystron changes, then change this PR to point to the merge or cherry-pick commit (unless you know a better way).
Fixes #299.